/* eslint-disable camelcase,@typescript-eslint/no-unused-vars */ // DO NOT EDIT THIS FILE. AUTO-GENERATED BY mobiletto-orm-typedef-gen import { H3Event } from "h3"; export default defineEventHandler(async (event: H3Event) => { return await filterErrors(event, "library.lookup", async (event: H3Event) => { return await requireAdminAccountObject(event, "library.lookup", async (event: H3Event, session, account) => { const libraryRepo = libraryRepository(); const id = event?.context?.params?.id; if (!id) throw notFound(libraryRepo.typeDef.idFieldName()); const library_by_id = await libraryRepo.safeFindById(id); if (library_by_id) return library_by_id; const library_by_name = await libraryRepo.safeFindFirstBy("name", id); if (library_by_name) return library_by_name; throw notFound(id); }); }); });